﻿//定义菜单模型
Ext.define
(
    'Menu',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'id', type: 'string' },
            { name: 'parentID', type: 'string' },
            { name: 'pageID', type: 'string' },
            { name: 'cls', type: 'string' },
            { name: 'iconCls', type: 'string' },
            { name: 'text', type: 'string' },
            { name: 'leaf', type: 'boolean' },
            { name: 'expanded', type: 'boolean' },
            { name: 'url', type: 'string' },
            { name: 'data', type: 'array' },
            { name: 'href', type: 'array' }
        ],
        idProperty: 'id'
    }
);

//定义账户模型
Ext.define
(
    'Account',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'User_ID', type: 'string' },
            { name: 'LoginName', type: 'string' },
            { name: 'IsEnabled', type: 'boolean' },
            { name: 'IsAuthorized', type: 'boolean' },
            { name: 'IsLocked', type: 'boolean' },
            { name: 'IsBuildin', type: 'boolean' },
            { name: 'MustChangePassword', type: 'boolean' },
            { name: 'HasSignature', type: 'boolean' },
            { name: 'LastLoginTime', type: 'date' },
            { name: 'EmployeeName', type: 'string' },
            { name: 'HasSignature', type: 'boolean' },
            { name: 'SignatureUrl', type: 'string' },
            { name: 'Department', type: 'string' },
            { name: 'Title', type: 'string' },
            { name: 'PhoneNumber1', type: 'string' },
            { name: 'PhoneNumber2', type: 'string' },
            { name: 'Email', type: 'string' },
            { name: 'Memo', type: 'string' }
        ],
        idProperty: 'User_ID'
    }
);

//定义角色模型
Ext.define
(
    'Role',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'Role_ID', type: 'string' },
            { name: 'Role_Name', type: 'string' },
            { name: 'Role_Title', type: 'string' },
            { name: 'Role_Desc', type: 'string' },
            { name: 'IsAssigned', type: 'boolean' }
        ],
        idProperty: 'Role_ID'
    }
);

//定义树节点数据模型
Ext.define
(
    'CheckableTreeNode',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'id', type: 'string' },
            { name: 'parentId', type: 'string' },
            { name: 'code', type: 'string' },
            { name: 'name', type: 'string' },
            { name: 'abbr', type: 'string' },
            { name: 'desc', type: 'string' },
            { name: 'leaf', type: 'boolean' },
            { name: 'checked', type: 'boolean' },
            { name: 'expanded', type: 'boolean' },
            { name: 'children', type: 'array' }
        ],
        idProperty: 'id'
    }
);

//定义树节点数据模型
Ext.define
(
    'TreeNode',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'id', type: 'string' },
            { name: 'parentId', type: 'string' },
            { name: 'code', type: 'string' },
            { name: 'name', type: 'string' },
            { name: 'text', type: 'string' },
            { name: 'abbr', type: 'string' },
            { name: 'desc', type: 'string' },
            { name: 'leaf', type: 'boolean' },
            { name: 'expanded', type: 'boolean' },
            { name: 'children', type: 'array' }
        ],
        idProperty: 'id'
    }
);

//定义组织结构数据模型
Ext.define
(
    'Organization',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'id', type: 'string' },
            { name: 'parentId', type: 'string' },
            { name: 'code', type: 'string' },
            { name: 'name', type: 'string' },
            { name: 'text', type: 'string' },
            { name: 'abbr', type: 'string' },
            { name: 'type', type: 'int' },
            { name: 'desc', type: 'string' },
            { name: 'leaf', type: 'boolean' },
            { name: 'expanded', type: 'boolean' },
            { name: 'children', type: 'array' }
        ],
        idProperty: 'id'
    }
);

//定义封装形式模型
Ext.define
(
    'Packaging',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'Packaging_ID', type: 'string' },
            { name: 'Packaging_Abbr', type: 'string' },
            { name: 'Packaging_Name', type: 'string' },
            { name: 'Memo', type: 'string' }
        ],
        idProperty: 'Packaging_ID',
        hasMany:
        [
            {
                model: 'UploadFile',
                name: 'Images'
            }
        ]
    }
);

//定义生产厂家模型
Ext.define
(
    'Manufactor',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'Manufactor_ID', type: 'string' },
            { name: 'Manufactor_Abbr', type: 'string' },
            { name: 'Manufactor_Name', type: 'string' },
            { name: 'Manufactor_WebSite', type: 'string' },
            { name: 'HasLogo', type: 'boolean' },
            { name: 'LogoUrl', type: 'string' },
            { name: 'Memo', type: 'string' }
        ],
        idProperty: 'Manufactor_ID'
    }
);

//定义上传文件模型
Ext.define
(
    'UploadFile',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'File_ID', type: 'string' },
            { name: 'File_Title', type: 'string' },
            { name: 'File_Name', type: 'string' },
            { name: 'File_Desc', type: 'string' },
            { name: 'HasContent', type: 'boolean' },
            { name: 'File_Order', type: 'int' },
            { name: 'IsNew', type: 'boolean' }
        ],
        idProperty: 'File_ID',
        hasMany:
       [
           {
               model: 'UploadFile',
               name: 'Images'
           }
       ]
    }
);

//定义黑名单
Ext.define
(
    'Blacklist',
    {
        extend: 'Ext.data.Model',
        fields:
        [
          { name: 'BlackListID', type: 'string' },
          { name: 'AccountID', type: 'string' },
          { name: 'OrganizationName', type: 'string' },
          { name: 'BusinessAddress', type: 'string' },
          { name: 'Businesslicense_SN', type: 'string' },
          { name: 'OrganizationCodeCertificate_SN', type: 'string' },
          { name: 'TaxRegistrationCertificate_SN', type: 'string' },
          { name: 'AccountOpeningLicense_SN', type: 'string' },
          { name: 'ArtificialPersonID', type: 'string' },
          { name: 'ArtificialPersonName', type: 'string' },
          { name: 'CreditAgenciesCodeCard', type: 'string' }
        ],
        idProperty: 'BlackListID'
    }
);
//操作类型模型
Ext.define
(
    'ActionType',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'ActionType_ID', type: 'string' },
            { name: 'ActionType_Code', type: 'string' },
            { name: 'ActionType_Name', type: 'string' },
            { name: 'Memo', type: 'string' }
        ],
        idProperty: 'ActionType_ID'
    }
);

//定义资料类型模型
Ext.define
(
    'FileType',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'FileType_ID', type: 'string' },
            { name: 'FileType_Name', type: 'string' },
            { name: 'Validity', type: 'int' },
            { name: 'IsEnabled', type: 'boolean' },
            { name: 'Memo', type: 'string' },
            { name: 'IsAssigned', type: 'boolean' },
            { name: 'Files', type: 'array' }
        ],
        idProperty: 'FileType_ID'
    }
);

//定义操作类型模型
Ext.define
(
    'OperationType',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'OperationType_ID', type: 'string' },
            { name: 'OperationType_Code', type: 'string' },
            { name: 'OperationType_Name', type: 'string' },
            { name: 'IsEnabled', type: 'boolean' },
            { name: 'Memo', type: 'string' }
        ],
        idProperty: 'OperationType_ID'
    }
);
//定义上传资料模型
Ext.define
(
    'ActiveOperationFiles',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'File_ID', type: 'string' },
            { name: 'Operation_ID', type: 'string' },
            { name: 'FileType_ID', type: 'int' },
            { name: 'IsDelayedDelivery', type: 'string' },
            { name: 'DueDate', type: 'string' },
            { name: 'Memo', type: 'string' },
            { name: 'Files', type: 'array' }
        ],
        idProperty: 'File_ID'
    }
);


//定义作业模型
Ext.define
(
    'ActiveOperations',
    {
        extend: 'Ext.data.Model',
        fields:
        [
            { name: 'Operation_ID', type: 'string' },
            { name: 'Operation_Code', type: 'string' },
            { name: 'OperationType_ID', type: 'string' },
            { name: 'Account_ID', TYPE: 'string' },
            { name: 'Status', type: 'string' },
            { name: 'Saler_ID', type: 'string' },
            { name: 'CompanyName', type: 'string' },
            { name: 'ContactPerson', type: 'string' },
            { name: 'IsSendInfo1', type: 'string' },
            { name: 'IsSendInfo2', type: 'string' },
            { name: 'IsSendInfo3', type: 'string' },
            { name: 'ContactNumber1', TYPE: 'string' },
            { name: 'ContactNumber2', TYPE: 'string' },
            { name: 'ContactNumber3', TYPE: 'string' },
            { name: 'ContactNumber11', type: 'string' },
            { name: 'ContactEmail', type: 'string' },
            { name: 'RegAddress', TYPE: 'string' },
            { name: 'YeZhiCode', type: 'string' },
            { name: 'OrgCode', type: 'string' },
            { name: 'ShiWCode', TYPE: 'string' },
            { name: 'Memo', type: 'string' },
        ],
        idProperty: 'Operation_ID'
    }
);